import {commonParams, option} from './config'
import jsonp from '@/common/js/jsonp'
import Axios from 'axios'
export function getRankList() {
  const url = 'api/ranklist'
  const data = Object.assign({}, commonParams, {
    uin: 0,
    format: 'json',
    platform: 'h5',
    needNewCode: 1,
    _: 1547343015988
  })
  return Axios.get(url, {
    params: data
  }).then((res) => {
    return Promise.resolve(res)
  }).catch(() => {
    console.log('出错了')
  })
}
export function getTopList() {
  const url = 'https://c.y.qq.com/v8/fcg-bin/fcg_myqq_toplist.fcg'
  const data = Object.assign({}, commonParams, {
    uin: 0,
    needNewCode: 1,
    platform: 'h5'
  })
  return jsonp(url, data, option)
}